package com.zhixue.media.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;

/**
 * @Auther: 李 力
 * @Date: 2025/3/31
 * @Description: com.lili.minio.config
 * @version: 1.0
 */
@Configuration
public class MinioConfig {


    @Value("${minio.url}")
    private String url;

    @Value("${minio.userName}")
    private String userName;

    @Value("${minio.password}")
    private String password;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                //端点
                .endpoint(url)
                //账号密码
                .credentials(userName, password)
                .build();

    }

}
